<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>微博舆情分析系统-首页</title>
    <script src="https://unpkg.com/vue@3"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/1.7.2/axios.js"></script>
    <style>
       body {
      animation: blink 2s infinite alternate;
    }

    @keyframes blink {
      0% {
        background-color: pink;
      }

      100% {
        background-color: skyblue;
      }
    }

    .titlename{
        position: relative;
        right:1%;
        text-decoration:overline;
        text-align:center;
        font-size: 20px;
        color: black;
      }

    .content{
        width: 90%;
        max-width: 90%; /* 添加最大宽度以防止在大屏幕上变得过大 */
        height: 100%;
        background-color: #ffffff;
        box-sizing: border-box;
        border-radius: 5px;
        margin-left: 5%;
        margin-top: 20px;
    }
    .guidebar{
        display: flex;
        justify-content: space-evenly;
        width: 100%;
        max-width: 100%; /* 添加最大宽度以防止在大屏幕上变得过大 */
        height: 60px;
        background-color: rgb(221, 196, 240);
        box-sizing: border-box;
        border-radius: 5px;
    }

    .time{
        position: relative;
        display: flex;
        justify-content:flex-start;
        flex-direction: row;
        width: 100%;
        max-width: 100%; /* 添加最大宽度以防止在大屏幕上变得过大 */
        height: 50px;
        background-color: rgba(196, 240, 214, 0.863);
        box-sizing: border-box;
        border-radius: 5px;
    }

    .button0{
            margin: 10px 5px 0 5px;
            width: 120px;
            height: 30px;
            border-radius: 5px;
            font-size: 10px;
            font-weight: 600;
            cursor: pointer;
            text-align: center;
            background: none;
            color: #6e6e6e;
            border-style: none;
            box-shadow: 0 0 8px rgba(102, 102, 102, 0.5);
    }

    h6{
        margin:15px 10px 10px 125px;
        font-size: 15px;
        color:#6e6e6e;
      }

    .button{
            margin-top: 5px;
            width: 150px;
            height: 50px;
            border-radius: 5px;
            font-size: 10px;
            font-weight: 600;
            cursor: pointer;
            text-align: center;
            background: none;
            color: #6e6e6e;
            border-style: none;
            box-shadow: 0 0 8px rgba(102, 102, 102, 0.5);
    }
    .homecontent{
      margin-top: 30px;
    }

    .display{ /* 热点话题变化趋势 */
        position: relative;
        width: 90%;
        max-width: 90%; /* 添加最大宽度以防止在大屏幕上变得过大 */
        height: 500px;
        background-color: #ffffff;
        box-sizing: border-box;
        border-radius: 5px;
        margin-left: 5%;
        margin-top: 40px;
        bottom: 10px;
        color: #ffffff;
        border-style: none;
        box-shadow: 0 0 8px rgba(102, 102, 102, 0.5);
        padding-left: 2%;
        padding-top: 15px;
        overflow: hidden;
    }

    .displayf{ /* 话题统计 */
      position: relative;
        display: flex;
        flex-direction:row;
        justify-content: space-around;
        width: 90%;
        max-width: 90%; /* 添加最大宽度以防止在大屏幕上变得过大 */
        height: 510px;
        background-color: #ffffff;
        box-sizing: border-box;
        border-radius: 5px;
        margin-left: 5%;
        margin-top: 40px;
        bottom: 10px;
        color: #ffffff;
        border-style: none;
        overflow: hidden;
    }

    .halfdisplay{
        display: inline-block;
        width: 45%;
        max-width: 45%; /* 添加最大宽度以防止在大屏幕上变得过大 */
        height: 500px;
        margin-top: 5px;
        background-color: #ffffff;
        box-sizing: border-box;
        border-radius: 5px;
        color: #ffffff;
        border-style: none;
        box-shadow: 0 0 8px rgba(102, 102, 102, 0.5);
        padding-top: 15px;
    }

    .image-container {
        width: 90%;  /* 设置盒子的宽度 */
        height: 90%; /* 设置盒子的高度 */
        margin-left: 4%;
    }

    .image-container img {
        width: 100%; /* 图片宽度自适应盒子宽度 */
        height: 100%; /* 图片高度自适应盒子高度 */
        object-fit: contain;
    }

    /* 新增的样式 */
    .topic-list {
        list-style: none;
        padding: 0;
        margin: 0;
        color: #333;
        font-size: 14px;
    }

    .topic-list li {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px;
        border-bottom: 1px solid #eee;
        color: black;
    }

    .topic-list li .rank {
        width: 30px;
        height: 30px;
        line-height: 30px;
        text-align: center;
        border-radius: 50%;
        background-color: #ff6f61;
        color: #fff;
        font-size: 14px;
        margin-right: 10px;
    }

    .topic-list li .rank:nth-child(1) {
        background-color: #ff6f61;
    }

    .topic-list li .rank:nth-child(2) {
        background-color: #ff9f43;
    }

    .topic-list li .rank:nth-child(3) {
        background-color: #ffcc33;
    }

    .topic-list li .rank:nth-child(n+4) {
        background-color: #ddd;
    }

    .topic-list li .title {
        flex-grow: 1;
    }

    .topic-list li .badge {
        background-color: #ff6f61;
        color: #fff;
        padding: 2px 5px;
        border-radius: 3px;
        font-size: 12px;
        margin-left: 10px;
    }

    .topic-list li .badge.hot {
        background-color: #ff6f61;
    }

    .topic-list li .badge.new {
        background-color: #ffcc33;
    }

    .topic-list li .count {
        color: #999;
    }

    </style>
</head>

<body onload="loadImage()">
    <div class="content">

        <div class="time">
        <h6>选择时间范围</h6>
        <input type="date" id="start_time" class="button0">
        <input type="date" id="end_time" class="button0">
        <button onclick="startCrawler()" class="button0">确定</button>
      </div>

        <div class="guidebar">
            <div>
                <button onclick="homepage()" class="button">首页</button>
                <button onclick="sentimentpage()" class="button">情感分析可视化</button>
                <button onclick="weibopage()" class="button">微博可视化</button>
                <button onclick="Kmeanspage()" class="button">微博KMeans聚类分析</button>
            </div>
            <div>
                <button onclick="exist()" class="button">退出登录</button>
                <button onclick="user()" class="button">欢迎你，用户user</button>
            </div>
        </div>
        <div class="homecontent">
            <div class="display" >
                <div class="titlename" >热点话题变化趋势</div>
                <div class="image-container">
                  <img id="homeimage-1" alt="加载中" />
                  </div>
              </div>

              <div class="displayf" >
                <div class="halfdisplay">
                      <div class="titlename" >热门话题统计</div>
                      <ul class="topic-list">
                        <li>
                            <div class="rank">1</div>
                            <div class="title">徐艺洋 老板就能上我卫生间吗</div>
                            <div class="badge hot">热</div>
                            <div class="count">3431841</div>
                        </li>
                        <li>
                            <div class="rank">2</div>
                            <div class="title">本月你的工资或有多项调整</div>
                            <div class="badge new">新</div>
                            <div class="count">979459</div>
                        </li>
                        <li>
                            <div class="rank">3</div>
                            <div class="title">60秒带你环游哈萨克斯坦</div>
                            <div class="count">608882</div>
                        </li>
                        <li>
                            <div class="rank">4</div>
                            <div class="title">外国男子强奸土耳其5岁女童引发骚乱</div>
                            <div class="count">581547</div>
                        </li>
                        <li>
                            <div class="rank">5</div>
                            <div class="title">泰国部长亲自接机中国娃圈女明星</div>
                            <div class="count">440985</div>
                        </li>
                        <li>
                            <div class="rank">6</div>
                            <div class="title">歌手 隆里电丝</div>
                            <div class="count">311792</div>
                        </li>
                        <li>
                            <div class="rank">7</div>
                            <div class="title">4名渔民饮用漂流瓶中液体后身亡</div>
                            <div class="badge new">新</div>
                            <div class="count">306829</div>
                        </li>
                        <li>
                            <div class="rank">8</div>
                            <div class="title">优酷今天官宣了好多剧</div>
                            <div class="count">303197</div>
                        </li>
                    </ul>
                </div>
                <div class="halfdisplay">
                    <div class="titlename" >话题点赞统计</div>
                    <div class="image-container">
                      <img id="homeimage-2" alt="加载中" />
                      </div>
              </div>
              </div>

              <div class="display" >
                <div class="titlename" >舆情周期分析</div>
                <div class="image-container">
                  <img id="homeimage-3" alt="加载中" />
                  </div>
              </div>


        </div>


    </div>


    <script>
        function homepage() {
      // 跳转到首页页面的逻辑
      window.location.href ='home.html';
        }
        function sentimentpage() {
      // 跳转到情感分析可视化页面的逻辑
      window.location.href ='sentiment.html';
        }
        function weibopage() {
      // 跳转到微博可视化页面的逻辑
      window.location.href ='weibo.html';
        }
        function Kmeanspage() {
      // 跳转到微博KMeans聚类分析页面的逻辑
      window.location.href ='Kmeans.html';
        }
        function exist() {
      // 跳转到登录页面的逻辑
      window.location.href ='login.html';
        }

        //获取图片url后是处理办法
        function loadImage() {
            loadhomeImage_1();
            loadhomeImage_2();
            loadhomeImage_3();
    }

    function loadhomeImage_1() {
            document.getElementById('homeimage-1').src ='https://test2022211.oss-cn-beijing.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20240703020029.png';
      /*axios.get('http://your_backend_url')
     .then(response => {
        document.getElementById('homeimage-1').src = response.data;
      })
     .catch(error => {
        console.error('获取图片 URL 时出错:', error);
      });*/
    }

    function loadhomeImage_2() {
            document.getElementById('homeimage-2').src ='https://test2022211.oss-cn-beijing.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20240703015834.png';
      /*axios.get('http://your_backend_url')
     .then(response => {
        document.getElementById('homeimage-2').src = response.data;
      })
     .catch(error => {
        console.error('获取图片 URL 时出错:', error);
      });*/
    }

    function loadhomeImage_3() {
            document.getElementById('homeimage-3').src ='https://test2022211.oss-cn-beijing.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20240703011810.png';
      /*axios.get('http://your_backend_url')
     .then(response => {
        document.getElementById('homeimage-3').src = response.data;
      })
     .catch(error => {
        console.error('获取图片 URL 时出错:', error);
      });*/
    }

    </script>

</body>
</html>
